package com.v.login;

import java.awt.Color;
import java.awt.Container;
import java.awt.Cursor;
import java.awt.Font;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.List;

import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.border.Border;
import javax.swing.border.LineBorder;

public class Recharge extends JDialog{
	private static final long serialVersionUID = 2389316971270763299L;
	//显示一个小手
	private Cursor hand = new Cursor(Cursor.HAND_CURSOR);


	private JLabel jl_Tips;//提示文本

	private JLabel jl_ten;//充值十元
	private JLabel jl_ten_Tips;//微信提示支付
	private JLabel jl_Twenty;//充值二十元
	private JLabel jl_thirty;//充值三十元
	private JLabel jl_fifty;//充值五十元
	private JLabel jl_hundred;//充值一百元

	private JLabel jl_QRCode;//二维码

	private JLabel jl_payment;//支付按钮

	public int number;

	private LineBorder huise = new LineBorder(Color.LIGHT_GRAY);
	private LineBorder lanse = new LineBorder(Color.BLUE);

	public Recharge(JFrame in) {
		super(in,"充值",false);
		setLayout(null);

		//文本
		jl_Tips = new JLabel("本平台只支持微信支付",JLabel.CENTER);
		jl_Tips.setFont(new Font("楷体", Font.BOLD, 30));//设置字体大小
		jl_Tips.setForeground(Color.black);//设置字体颜色
		jl_Tips.setBounds(200, 10, 350, 30);//设置位置
		add(jl_Tips);




		//充值十元
		jl_ten = new JLabel("10元",JLabel.CENTER);
		jl_ten.setBounds(50, 100, 100, 30);
		jl_ten.setBorder(new LineBorder(Color.LIGHT_GRAY));
		jl_ten.setFont(new Font("楷体", Font.PLAIN, 18));
		jl_ten.setCursor(hand);

		//获取原来的背景颜色
		//鼠标点击事件
		jl_ten.addMouseListener(new MouseAdapter() {

			@Override
			public void mouseClicked(MouseEvent e) {
				ImageIcon icon = new ImageIcon(Interface.class.getResource("十元.png"));
				jl_QRCode.setIcon(icon);

				ImageIcon icon2 = new ImageIcon(Interface.class.getResource("微信支付10元.png"));
				jl_ten_Tips.setIcon(icon2);

				jl_ten.setBorder(lanse);

				//还原其他的图标颜色
				jl_Twenty.setBorder(huise);
				jl_hundred.setBorder(huise);
				jl_fifty.setBorder(huise);
				jl_thirty.setBorder(huise);
			}

		});
		jl_ten.setForeground(Color.black);

		add(jl_ten);

		//充值二十元
		jl_Twenty = new JLabel("20元",JLabel.CENTER);
		jl_Twenty.setBounds(200, 100, 100, 30);
		jl_Twenty.setBorder(new LineBorder(Color.LIGHT_GRAY));
		jl_Twenty.setFont(new Font("楷体", Font.PLAIN, 18));
		jl_Twenty.setCursor(hand);
		//获取原来的背景颜色


		//鼠标点击事件
		jl_Twenty.addMouseListener(new MouseAdapter() {

			@Override
			public void mouseClicked(MouseEvent e) {
				ImageIcon icon = new ImageIcon(Interface.class.getResource("二十元.png"));
				jl_QRCode.setIcon(icon);

				ImageIcon icon2 = new ImageIcon(Interface.class.getResource("微信支付20元.png"));
				jl_ten_Tips.setIcon(icon2);

				jl_Twenty.setBorder(lanse);

				//还原其他的图标颜色
				jl_ten.setBorder(huise);
				jl_hundred.setBorder(huise);
				jl_fifty.setBorder(huise);
				jl_thirty.setBorder(huise);
			}
		});
		jl_Twenty.setForeground(Color.black);
		add(jl_Twenty);

		//充值三十元
		jl_thirty = new JLabel("30元",JLabel.CENTER);
		jl_thirty.setBounds(350, 100, 100, 30);
		jl_thirty.setBorder(new LineBorder(Color.LIGHT_GRAY));
		jl_thirty.setFont(new Font("楷体", Font.PLAIN, 18));
		jl_thirty.setCursor(hand);
		jl_thirty.setForeground(Color.black);
		//鼠标点击事件
		jl_thirty.addMouseListener(new MouseAdapter() {

			@Override
			public void mouseClicked(MouseEvent e) {
				ImageIcon icon = new ImageIcon(Interface.class.getResource("三十元.png"));
				jl_QRCode.setIcon(icon);

				ImageIcon icon2 = new ImageIcon(Interface.class.getResource("微信支付30元.png"));
				jl_ten_Tips.setIcon(icon2);


				jl_thirty.setBorder(lanse);

				//还原其他的图标颜色
				jl_Twenty.setBorder(huise);
				jl_ten.setBorder(huise);

				jl_hundred.setBorder(huise);

				jl_fifty.setBorder(huise);
			}
		});
		add(jl_thirty);

		//充值五十元
		jl_fifty = new JLabel("50元",JLabel.CENTER);
		jl_fifty.setBounds(500, 100, 100, 30);
		jl_fifty.setBorder(new LineBorder(Color.LIGHT_GRAY));
		jl_fifty.setFont(new Font("楷体", Font.PLAIN, 18));
		jl_fifty.setCursor(hand);
		jl_fifty.setForeground(Color.black);
		//鼠标点击事件
		jl_fifty.addMouseListener(new MouseAdapter() {

			@Override//鼠标点击事件
			public void mouseClicked(MouseEvent e) {
				ImageIcon icon = new ImageIcon(Interface.class.getResource("五十元.png"));
				jl_QRCode.setIcon(icon);

				ImageIcon icon2 = new ImageIcon(Interface.class.getResource("微信支付50元.png"));
				jl_ten_Tips.setIcon(icon2);

				//
				jl_fifty.setBorder(lanse);
				//还原其他的图标颜色
				jl_Twenty.setBorder(huise);
				jl_thirty.setBorder(huise);
				jl_ten.setBorder(huise);
				jl_hundred.setBorder(huise);
			}
		});
		add(jl_fifty);

		//充值一百元
		jl_hundred = new JLabel("100元",JLabel.CENTER);
		jl_hundred.setBounds(650, 100, 100, 30);
		jl_hundred.setBorder(new LineBorder(Color.LIGHT_GRAY));
		jl_hundred.setFont(new Font("楷体", Font.PLAIN, 18));
		jl_hundred.setCursor(hand);
		jl_hundred.setForeground(Color.black);
		//鼠标点击事件
		jl_hundred.addMouseListener(new MouseAdapter() {

			@Override//鼠标点击事件
			public void mouseClicked(MouseEvent e) {
				ImageIcon icon = new ImageIcon(Interface.class.getResource("一百元.png"));
				jl_QRCode.setIcon(icon);

				ImageIcon icon2 = new ImageIcon(Interface.class.getResource("微信支付100元.png"));
				jl_ten_Tips.setIcon(icon2);

				//
				jl_hundred.setBorder(lanse);
				//还原其他的图标颜色
				jl_Twenty.setBorder(huise);
				jl_fifty.setBorder(huise);
				jl_thirty.setBorder(huise);
				jl_ten.setBorder(huise);


			}
		});
		add(jl_hundred);

		//初始二维码
		jl_QRCode = new JLabel(new ImageIcon(Interface.class.getResource("十元.png")));
		jl_QRCode.setBounds(290, 250, 230, 230);
		add(jl_QRCode);
		jl_ten_Tips = new JLabel(new ImageIcon(Interface.class.getResource("微信支付10元.png")));
		jl_ten_Tips.setBounds(320, 190, 172, 30);
		add(jl_ten_Tips);

		//支付充值按钮
		jl_payment = new JLabel(new ImageIcon(Interface.class.getResource("支付充值按钮.png")));
		jl_payment.setBounds(320, 500, 172, 30);
		jl_payment.setCursor(hand);
		add(jl_payment);



		setTitle("充值界面");
		setResizable(false);
		setSize(800, 600);
		setLocationRelativeTo(null);
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setVisible(true);


	}



	public static void main(String[] args) {
		new Recharge(null);

	}

}
